package com.example.authserver.controller;

import com.wf.captcha.ChineseGifCaptcha;
import com.wf.captcha.utils.CaptchaUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class LoginController {
    @GetMapping("/login.html")
    public String login() {
        return "login";
    }

    @RequestMapping("/captcha")
    public void captcha(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ChineseGifCaptcha gifCaptcha = new ChineseGifCaptcha(110,38,4);
        CaptchaUtil.out(gifCaptcha, request, response);
    }

}
